package com.xwj.service.database2.impl;

import com.xwj.dao.database2.StorageMapper;
import com.xwj.service.database2.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author xwj
 * @date 2020/12/11
 */
@Service
public class StorageServiceImpl implements StorageService {
    @Autowired
    private StorageMapper storageMapper;

    @Override
    @Transactional(value = "dataTransactionManager2", rollbackFor = Exception.class, propagation = Propagation.NESTED)
    public int decrease(Long productId, Integer count) {
        return storageMapper.decrease(productId, count);
    }
}
